home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / Finder.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  6.3 KB  |  214 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Finder.h
  3.  
  4.      Contains:    Finder flags and container types.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1990-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __FINDER__
  19. #define __FINDER__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __DIALOGS__
  25. #include <Dialogs.h>
  26. #endif
  27.  
  28.  
  29.  
  30. #if PRAGMA_ONCE
  31. #pragma once
  32. #endif
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. #if PRAGMA_IMPORT
  39. #pragma import on
  40. #endif
  41.  
  42. #if PRAGMA_STRUCT_ALIGN
  43.     #pragma options align=mac68k
  44. #elif PRAGMA_STRUCT_PACKPUSH
  45.     #pragma pack(push, 2)
  46. #elif PRAGMA_STRUCT_PACK
  47.     #pragma pack(2)
  48. #endif
  49.  
  50.  
  51. enum {
  52.     kCustomIconResource            = -16455                        /* Custom icon family resource ID */
  53. };
  54.  
  55.  
  56. enum {
  57.     kContainerFolderAliasType    = FOUR_CHAR_CODE('fdrp'),        /* type for folder aliases */
  58.     kContainerTrashAliasType    = FOUR_CHAR_CODE('trsh'),        /* type for trash folder aliases */
  59.     kContainerHardDiskAliasType    = FOUR_CHAR_CODE('hdsk'),        /* type for hard disk aliases */
  60.     kContainerFloppyAliasType    = FOUR_CHAR_CODE('flpy'),        /* type for floppy aliases */
  61.     kContainerServerAliasType    = FOUR_CHAR_CODE('srvr'),        /* type for server aliases */
  62.     kApplicationAliasType        = FOUR_CHAR_CODE('adrp'),        /* type for application aliases */
  63.     kContainerAliasType            = FOUR_CHAR_CODE('drop'),        /* type for all other containers */
  64.                                                                 /* types for Special folder aliases */
  65.     kSystemFolderAliasType        = FOUR_CHAR_CODE('fasy'),
  66.     kAppleMenuFolderAliasType    = FOUR_CHAR_CODE('faam'),
  67.     kStartupFolderAliasType        = FOUR_CHAR_CODE('fast'),
  68.     kPrintMonitorDocsFolderAliasType = FOUR_CHAR_CODE('fapn'),
  69.     kPreferencesFolderAliasType    = FOUR_CHAR_CODE('fapf'),
  70.     kControlPanelFolderAliasType = FOUR_CHAR_CODE('fact'),
  71.     kExtensionFolderAliasType    = FOUR_CHAR_CODE('faex'),        /* types for AppleShare folder aliases */
  72.     kExportedFolderAliasType    = FOUR_CHAR_CODE('faet'),
  73.     kDropFolderAliasType        = FOUR_CHAR_CODE('fadr'),
  74.     kSharedFolderAliasType        = FOUR_CHAR_CODE('fash'),
  75.     kMountedFolderAliasType        = FOUR_CHAR_CODE('famn')
  76. };
  77.  
  78.  
  79. enum {
  80.                                                                 /* Finder Flags */
  81.     kIsOnDesk                    = 0x0001,
  82.     kColor                        = 0x000E,
  83.     kIsShared                    = 0x0040,                        /* bit 0x0080 is hasNoINITS */
  84.     kHasBeenInited                = 0x0100,                        /* bit 0x0200 was the letter bit for AOCE, but is now reserved for future use */
  85.     kHasCustomIcon                = 0x0400,
  86.     kIsStationery                = 0x0800,
  87.     kNameLocked                    = 0x1000,
  88.     kHasBundle                    = 0x2000,
  89.     kIsInvisible                = 0x4000,
  90.     kIsAlias                    = 0x8000
  91. };
  92.  
  93. #if OLDROUTINENAMES
  94.  
  95. enum {
  96.     kIsStationary                = kIsStationery
  97. };
  98.  
  99. #endif  /* OLDROUTINENAMES */
  100.  
  101. /*    
  102.     The following declerations used to be in Files.≈, 
  103.     but are Finder specific and were moved here.
  104. */
  105.  
  106. enum {
  107.                                                                 /* Finder Constants */
  108.     fOnDesk                        = 1,
  109.     fHasBundle                    = 8192,
  110.     fTrash                        = -3,
  111.     fDesktop                    = -2,
  112.     fDisk                        = 0
  113. };
  114.  
  115. struct FInfo {
  116.     OSType                             fdType;                        /*the type of the file*/
  117.     OSType                             fdCreator;                    /*file's creator*/
  118.     unsigned short                     fdFlags;                    /*flags ex. hasbundle,invisible,locked, etc.*/
  119.     Point                             fdLocation;                    /*file's location in folder*/
  120.     short                             fdFldr;                        /*folder containing file*/
  121. };
  122. typedef struct FInfo FInfo;
  123.  
  124. struct FXInfo {
  125.     short                             fdIconID;                    /*Icon ID*/
  126.     short                             fdUnused[3];                /*unused but reserved 6 bytes*/
  127.     SInt8                             fdScript;                    /*Script flag and number*/
  128.     SInt8                             fdXFlags;                    /*More flag bits*/
  129.     short                             fdComment;                    /*Comment ID*/
  130.     long                             fdPutAway;                    /*Home Dir ID*/
  131. };
  132. typedef struct FXInfo FXInfo;
  133.  
  134. struct DInfo {
  135.     Rect                             frRect;                        /*folder rect*/
  136.     unsigned short                     frFlags;                    /*Flags*/
  137.     Point                             frLocation;                    /*folder location*/
  138.     short                             frView;                        /*folder view*/
  139. };
  140. typedef struct DInfo DInfo;
  141.  
  142. struct DXInfo {
  143.     Point                             frScroll;                    /*scroll position*/
  144.     long                             frOpenChain;                /*DirID chain of open folders*/
  145.     SInt8                             frScript;                    /*Script flag and number*/
  146.     SInt8                             frXFlags;                    /*More flag bits*/
  147.     short                             frComment;                    /*comment*/
  148.     long                             frPutAway;                    /*DirID*/
  149. };
  150. typedef struct DXInfo DXInfo;
  151.  
  152.  
  153. /* Values of the 'message' parameter to a Control Panel 'cdev' */
  154.  
  155. enum {
  156.     initDev                        = 0,                            /*Time for cdev to initialize itself*/
  157.     hitDev                        = 1,                            /*Hit on one of my items*/
  158.     closeDev                    = 2,                            /*Close yourself*/
  159.     nulDev                        = 3,                            /*Null event*/
  160.     updateDev                    = 4,                            /*Update event*/
  161.     activDev                    = 5,                            /*Activate event*/
  162.     deactivDev                    = 6,                            /*Deactivate event*/
  163.     keyEvtDev                    = 7,                            /*Key down/auto key*/
  164.     macDev                        = 8,                            /*Decide whether or not to show up*/
  165.     undoDev                        = 9,
  166.     cutDev                        = 10,
  167.     copyDev                        = 11,
  168.     pasteDev                    = 12,
  169.     clearDev                    = 13,
  170.     cursorDev                    = 14
  171. };
  172.  
  173.  
  174. /* Special values a Control Panel 'cdev' can return */
  175.  
  176. enum {
  177.     cdevGenErr                    = -1,                            /*General error; gray cdev w/o alert*/
  178.     cdevMemErr                    = 0,                            /*Memory shortfall; alert user please*/
  179.     cdevResErr                    = 1,                            /*Couldn't get a needed resource; alert*/
  180.     cdevUnset                    = 3                                /* cdevValue is initialized to this*/
  181. };
  182.  
  183. /* Control Panel Default Proc */
  184. typedef CALLBACK_API( long , ControlPanelDefProcPtr )(short message, short item, short numItems, short cPanelID, EventRecord *theEvent, long cdevValue, DialogPtr cpDialog);
  185. typedef STACK_UPP_TYPE(ControlPanelDefProcPtr)                     ControlPanelDefUPP;
  186. enum { uppControlPanelDefProcInfo = 0x000FEAB0 };                 /* pascal 4_bytes Func(2_bytes, 2_bytes, 2_bytes, 2_bytes, 4_bytes, 4_bytes, 4_bytes) */
  187. #define NewControlPanelDefProc(userRoutine)                     (ControlPanelDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppControlPanelDefProcInfo, GetCurrentArchitecture())
  188. #define CallControlPanelDefProc(userRoutine, message, item, numItems, cPanelID, theEvent, cdevValue, cpDialog)  CALL_SEVEN_PARAMETER_UPP((userRoutine), uppControlPanelDefProcInfo, (message), (item), (numItems), (cPanelID), (theEvent), (cdevValue), (cpDialog))
  189.  
  190.  
  191.  
  192.  
  193.  
  194. #if PRAGMA_STRUCT_ALIGN
  195.     #pragma options align=reset
  196. #elif PRAGMA_STRUCT_PACKPUSH
  197.     #pragma pack(pop)
  198. #elif PRAGMA_STRUCT_PACK
  199.     #pragma pack()
  200. #endif
  201.  
  202. #ifdef PRAGMA_IMPORT_OFF
  203. #pragma import off
  204. #elif PRAGMA_IMPORT
  205. #pragma import reset
  206. #endif
  207.  
  208. #ifdef __cplusplus
  209. }
  210. #endif
  211.  
  212. #endif /* __FINDER__ */
  213.  
  214.